<!--
 * @Author: zhangmengqiong
 * @Date: 2021-05-11 10:17:17
 * @LastEditors: zhangmengqiong
 * @LastEditTime: 2021-05-11 15:07:46
-->
<template>
  <div class="common-card">
    <div class="title">{{ title }}</div>
    <div class="value">{{ value }}</div>
    <div class="chart">
      <slot></slot>
    </div>
    <div class="line"></div>
    <div class="total">
      <slot name="footer"></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ""
    },
    value: {
      type: String,
      default: ""
    }
  }
};
</script>

<style lang="scss" scoped>
.title {
  font-size: 12px;
  color: #999;
}
.value {
  font-size: 24px;
  color: #333;
  margin-top: 5px;
  letter-spacing: 1px;
}
.chart {
  height: 50px;
  width: 100%;
}
.line {
  margin: 10px 0;
  border-top: 1px solid #eee;
}
.total {
  font-size: 12px;
  color: #666;
}
</style>
<style lang="scss">
.emphasis {
  color: #000;
  font-weight: 700;
  margin-left: 5px;
}
.increase {
  width: 0;
  height: 0;
  border: 3px;
  border-color: transparent transparent red transparent;
  border-style: solid;
  margin: 0 0 3px 5px;
}
.decrease {
  width: 0;
  height: 0;
  border: 3px;
  border-color: green transparent transparent transparent;
  border-style: solid;
  margin: 3px 0 0px 5px;
}
</style>
